class Message < ActiveRecord::Base

  # scope
  default_scope -> { order("created_at DESC") }

  # Associations
  belongs_to :sender, class_name: "User", foreign_key: "sender_id"
  belongs_to :receiver, class_name: "User", foreign_key: "receiver_id"
end